package cn.jhz.learn.blog.vo.article.query.page;

import cn.jhz.learn.blog.vo.PageView;
import lombok.Getter;
import lombok.Setter;
import lombok.ToString;

import javax.validation.constraints.Max;
import javax.validation.constraints.Min;

import java.util.Optional;

@Setter
@Getter
@ToString
public class ConsolePageView extends PageView {

    @Min(value = 0, message = "公开属性无效!")
    @Max(value = 2, message = "公开属性无效!")
    private Byte visibility;

    @Min(value = 0, message = "无效状态!")
    @Max(value = 4, message = "无效状态!")
    private Byte status;


    public Optional<Byte> getVisibility() {
        return Optional.ofNullable(this.visibility);
    }

    public Optional<Byte> getStatus() {
        return Optional.ofNullable(this.status);
    }
}
